from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template

import content
import sys
import os

sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))


template.register_template_library('lib.customfilters')

def main():
    application = webapp.WSGIApplication([
        ('/', content.IndexHandler),
        ('/d', content.DateHandler),
        ('/([0-9a-z]{6})$', content.SecondScreenHandler),
        ('/m', content.MechFromSmurfyHandler),
        # ('/json', content.JsonHandler),
        ('/n', content.RandomMechnameHandler),
        ('/m', content.ContactHandler),
        ('/g', content.GarageHandler),
        ('/t', content.TestHandler),
        ('/.*', content.UnknownHandler)
    ], debug=True)

    util.run_wsgi_app(application)

if __name__ == '__main__':
    main()
